package services

import (
	"context"
)

type ProductServer struct {
}

func (this *ProductServer) ProductList(cxt context.Context, req *Query) (*Products, error) {
	enumtype := ""
	if req.Type == EnumType_TYPE_C {
		enumtype = "EnumType_TYPE_C"
	} else if (req.Type == EnumType_TYPE_B) {
		enumtype = "EnumType_TYPE_B"
	} else {
		enumtype = "EnumType_TYPE_A"
	}

	return &Products{
		Product: []*Product{
			{ProId: 1, ProName: "产品1:" + enumtype},
			{ProId: 2, ProName: "产品2:" + enumtype},
			{ProId: 3, ProName: "产品3:" + enumtype},
		},
	}, nil
}
